package com.chrray.position.domain.dto;

import lombok.Data;

import java.util.List;

/**
 * @author liujianxin
 * @date 2024/08/28 21:15
 */
@Data
public class DictionaryDTO {
    private Long pId;
    private String pName;
    private Long value;
    private String label;
    private int hot;
    private List<DictionaryDTO> children;

    public static DictionaryDTO asHot(List<DictionaryDTO> hots) {
        DictionaryDTO item = new DictionaryDTO();
        item.setValue(-1L);
        item.setLabel("热门类型");
        item.setChildren(hots);
        return item;
    }


    public boolean hasChildren() {
        return children != null && !children.isEmpty();
    }
}
